//识别活动id
		var ActivityId;
		var Request = new Object();
		Request = GetRequest();
		function GetRequest() {
		    var url = location.search; //获取url中"?"符后的字串
		    var theRequest = new Object();
		    if (url.indexOf("?") != -1) {
		        var str = url.substr(1);
		        strs = str.split("&");
		        for(var i = 0; i < strs.length; i ++) {
		            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
		        }
		    }
		    return theRequest;
		}
		ActivityId=Request["id"];

//加载报名名单
var UrlList = DataURL + 'bank/activity/getActivityListByDeptId?activityId=';
loadEntryList();
function loadEntryList() {
	$.ajax({
		type : "GET",
		url : UrlList+ActivityId,
		dataType : 'json',
		async : false,
		success : function(data) {
			if(checkTokenError(data)){
			data_content = JSON.stringify(data);
			TableData = data.content.data;
			//console.log(TableData);
			EntryTable(TableData);
			}
		},
        error:function(data){
            console.log(data)
            zxTips_short({
    			txt : "系统错误"
    			});
        }
	});
}
//加载活动信息
var GetDataURL=DataURL+"bank/activity/getActivityById";
var ActivityGetData={};//获得活动数据

$.ajax({
	type : "GET",
	url : GetDataURL,
	dataType : 'json',
	async : false,
	data : {"id":ActivityId},
	success : function(data) {
		if(checkTokenError(data)){
		//console.log(data.content.data.data);
		ActivityGetData = data.content.data.data;
		if(ActivityGetData)
		InputInfo(ActivityGetData);
		}
	},
    error:function(data){
        console.log(data)
        zxTips_short({
			txt : "系统错误"
			});
    }
});
function InputInfo(ActivityGetData){
	$(".activity-name").text(ActivityGetData.theme);
	$(".activity-pic img").attr("src",ActivityGetData.picturePath);
	$(".activity-object").text(ActivityGetData.object);
	$(".activity-time").text(format(ActivityGetData.dateStart)+"-"+format(ActivityGetData.dateEnd));
}
//时间戳转换为字符串
function add0(m){return m<10?'0'+m:m }
function format(TimeC)
{
var time = new Date(TimeC);
var y = time.getFullYear();
var m = time.getMonth()+1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var s = time.getSeconds();
return y+'.'+add0(m)+'.'+add0(d);
}  
//调用列表参数
function EntryTable(TableData) {
	TableData.sort(DataSortUpById);
	var TableList = "";
	for (var i = 0; i < TableData.length; i++) {
		TableList += '<tr>';
		TableList += '<td>'+TableData[i].phone+'</td>';
		TableList += '</tr>';
	}
	$('#StatisticsTable').find('tbody').html(TableList);
}
//列表ID排序
function DataSortUpById(x, y) {
	return (x.id < y.id) ? 1 : -1

}

$('#StatisticsTable')
.DataTable(
		{
			"searching" : false,
			"info" : false,
			"lengthChange" : false,
			"pageLength" : 10,
			"ordering" : false,
			language : {
				"sEmptyTable" : "没有数据！",
				"oPaginate" : {

					"sPrevious" : '<',
					"sNext" : '>',

				},
			}
		});





//加载统计图数据
var GetStatisticsURL=DataURL+"bank/activity/getActivityListCountByDay";
var StatisticsData={};//获得统计数据
$.ajax({
	type : "GET",
	url : GetStatisticsURL,
	dataType : 'json',
	async : false,
	data : {"activityId":ActivityId,"day":7},
	success : function(data) {
		if(checkTokenError(data)){
		//console.log(data.content.data);
		StatisticsData = data.content.data;
		StatisticsData.sort(DataSortUpByDateTime);
		console.log(StatisticsData);
		}
	},
    error:function(data){
        console.log(data)
        zxTips_short({
			txt : "系统错误"
			});
    }
});
function DataSortUpByDateTime(x, y) {
	return (x.dateTime > y.dateTime) ? 1 : -1
}
var WeekData=[];
var peopleNum=[];

for(var i=0;i<StatisticsData.length;i++){
	WeekData[i]=StatisticsData[i].dateTime;
	peopleNum[i]=StatisticsData[i].amount;
}

//加载评分数据
var GetGradeURL=DataURL+"bank/activity/grade/statistic";
var GradeData={};//获得评分数据
$.ajax({
	type : "GET",
	url : GetGradeURL,
	dataType : 'json',
	async : false,
	data : {"activityId":ActivityId},
	success : function(data) {
		if(checkTokenError(data)){
		//console.log(data.content.data);
		GradeData = data.content.data;
		}
	},
    error:function(data){
        console.log(data)
        zxTips_short({
			txt : "系统错误"
			});
    }
});

var PieTitle=['一星','二星','三星','四星','五星']
var PieData=[];
if(GradeData[0]){
for(var i=0;i<PieTitle.length;i++){
	if(GradeData[i].count){
		PieData[i]=[PieTitle[i],GradeData[i].count];
	}
	else {PieData[i]=[PieTitle[i],0];}
}
}
else{$(".pie-mode").html('<div class="tips" style="width: 100%; height: 200px; margin: 0 auto;text-align:center;line-height: 200px;">尚未有人评分！</div>');}

$(function () {
    $('.activity-line').highcharts({
        title: {
            text: '',
        },
        credits:{enabled : false,},
        xAxis: {
            categories: WeekData
        },
        yAxis: {
            title: {
                text: ''
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        legend: {
        	enabled : false,
        },
        series: [{
            name: '人数',
            data: peopleNum
        }]
    });
    
    
    $('.activity-pie').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: ''
        },
        credits:{enabled : false,},
        tooltip: {
            headerFormat: '{series.name}<br>',
            pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                    style: {
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                    }
                }
            }
        },
        series: [{
            type: 'pie',
            name: '评分星级占比',
            data: PieData
        }],
        colors: ['#c4d64c', '#d6c74c', '#d6a74c', '#d68a4c', '#d64c4c'],
    });
    
    
});